﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ObjectSweptVolume.CApObjectSweptVolumeVMCommand
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Windows.Input;


namespace DnProcessSimulateCommands.ObjectSweptVolume;

public class CApObjectSweptVolumeVMCommand : ICommand
{
  private readonly Action _execute;
  private readonly Func<bool> _canExecute;

  public CApObjectSweptVolumeVMCommand(Action execute)
    : this(execute, (Func<bool>) null)
  {
  }

  public CApObjectSweptVolumeVMCommand(Action execute, Func<bool> canExecute)
  {
    this._execute = execute;
    this._canExecute = canExecute;
  }

  public event EventHandler CanExecuteChanged;

  public void RaiseCanExecuteChanged()
  {
    EventHandler canExecuteChanged = this.CanExecuteChanged;
    if (canExecuteChanged == null)
      return;
    canExecuteChanged((object) null, (EventArgs) null);
  }

  public bool CanExecute(object parameter) => this._canExecute == null || this._canExecute();

  public void Execute(object parameter)
  {
    Action execute = this._execute;
    if (execute == null)
      return;
    execute();
  }
}
